new Vue({
  el: '#app',
  data() {
    return {
      tabPosition: 'left',
      tableData: [{
        date: '2016-05-02',
        name: '王小虎',
        address: '上海市普陀区金沙江路 1518 弄'
      }],
      list: [],
      list1: [],
      option: [
        {
          xAxis: {   //柱状图
            type: 'category',
            data: ['销售', '管理', '财务', '研发', '生产', '税费']
          },
          yAxis: {
            type: 'value'
          },
          series: [
            {
              data: [120, 200, 150, 80, 70, 110, 130],
              type: 'bar',
              showBackground: true,
              backgroundStyle: {
                color: 'rgba(180, 180, 180, 0.2)'
              }
            }
          ]
        },
        {
          tooltip: {
            trigger: 'item'
          },
          legend: {
            top: '5%',
            left: 'center'
          },
          series: [
            {
              name: '费用科目',
              type: 'pie',
              radius: ['40%', '80%'],
              avoidLabelOverlap: false,
              label: {
                show: false,
                position: 'center'
              },
              emphasis: {
                label: {
                  show: true,
                  fontSize: 20,
                  fontWeight: 'bold'
                }
              },
              labelLine: {
                show: false
              },

              data: [
                { value: 1048, name: '销售费用' },
                { value: 735, name: '管理费用' },
                { value: 580, name: '财务费用' },
                { value: 484, name: '研发费用' },
                { value: 300, name: '生产费用' },
                { value: 500, name: '税费费用' }]
            }
          ]
        },]
    }
  },
  mounted() {
    let myChart = echarts.init(document.getElementById('main'));
    let myCharts = echarts.init(document.getElementById('histogram'));
    myChart.setOption(this.option[1])
    myCharts.setOption(this.option[0])
    // 树状图数据
    console.log(this.option[0].xAxis.data)
    console.log(this.option[1].series[0].data)
    this.list1 = [
      { value: 1048, name: '销售费用' },
      { value: 735, name: '管理费用' },
      { value: 580, name: '财务费用' },
      { value: 484, name: '研发费用' },
      { value: 300, name: '生产费用' },
      { value: 500, name: '税费费用' }]
    console.log(this.list1)
    let data1 = ['销售', '管理', '财务', '研发', '生产', '税费']
    this.list = this.list1
  },
  methods: {
  },
})